from rest_framework import serializers
from goods.models import CategoryVisitCount

#1,商品分类访问序列化器
class GoodCategorySerializer(serializers.ModelSerializer):
    # category = serializers.CharField(read_only=True,label="商品分类")
    category = serializers.StringRelatedField(read_only=True,label="商品分类")
    class Meta:
        model = CategoryVisitCount
        fields = "__all__"
